
package cz.czu.pef.DataModelling.ejb.impl;

import java.util.List;
import java.util.logging.Logger;

import javax.ejb.*;

import cz.czu.pef.DataModelling.ejb.api.DataModellingEjbInterface;
import cz.czu.pef.DataModelling.service.api.*;
import cz.czu.pef.DataModelling.utils.SpringLoader;


@Stateless(name = "dataModellingEJB", mappedName = "dataModellingEJB")
@Remote
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class DataModellingEjb implements DataModellingEjbInterface
{

  Logger logger = Logger.getLogger(DataModellingEjb.class.getName());

  DataModellingService dataModellingService;

  @Override
  public List<Object[]> getAllMissingTrainings()
  {
    dataModellingService = SpringLoader.getContext().getBean(DataModellingService.class);
    return dataModellingService.getAllMissingTrainings();
  }

  @Override
  public List<Object[]> getAllMissingMedicalExaminations()
  {
    dataModellingService = SpringLoader.getContext().getBean(DataModellingService.class);
    return dataModellingService.getAllMissingMedicalExaminations();
  }

  @Override
  public List<Object[]> getAllMachineryWorkers()
  {
    dataModellingService = SpringLoader.getContext().getBean(DataModellingService.class);
    return dataModellingService.getAllMachineryWorkers();
  }

}
